<template>
    <div>
        user + {{$route.params.id}}
</div>
</template>
<script setup>
import { reactive ,ref} from 'vue'

import {onBeforeRouteUpdate, useRoute} from 'vue-router'
const route = useRoute()
console.log('代码中',route.params.id);

// 获取route跳转ID
onBeforeRouteUpdate((to,from)=>{
    console.log('from',from.params.id);
    console.log('to',to.params.id);
})
</script>
<style  scoped>
    /*局部css 支持css3 可以改变elementUI组件的样式 且组件样式调整只在本页面生效**/
    /*主样式*/
</style>